package com.woniuxy.course.controller;

import com.woniuxy.course.service.VodService;
import com.woniuxy.course.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author CodingMaster
 * @create 2020-08-04 19:37
 * @description
 */
@CrossOrigin //跨域
@RestController
@RequestMapping("/vodService")
public class VodController {
    @Autowired
    private VodService vodService;
    @PostMapping("uploadVideo")
    public R uploadAlyiVideo(MultipartFile file) {


        //返回上传视频id
        String videoId = vodService.uploadVideoAly(file);
        return R.ok().data("videoId",videoId);
    }
}
